package com.cwj.designpatterns.abstractfactory;

/**
 * @author chenwujie
 * @date 2021-03-16 10:40
 */
public class AbstractfactoryTest {
    public static void main(String[] args) {

        Farm f1 = new TomsFarm();
        Animal animal = f1.createAnimal();
        Fruit fruit = f1.createFruit();
        animal.printName();
        fruit.printName();
        System.out.println("---------------------");
        Farm f2 = new JacksFarm();
        Animal animal2 = f2.createAnimal();
        Fruit fruit2 = f2.createFruit();
        animal2.printName();
        fruit2.printName();
    }
}
